<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>订单列表</title>
    <%- include("../include/header.ejs") %>
    <style>
        .ui-jqgrid
        {
            font-size:0.8rem
        }
    </style>
</head>
<body style="width: 100%;overflow-x: hidden">
<div>
    <select id="sid" name="sid">
        <%for(var id in ret.server){%>
        <option value="<%=id%>"><%=ret.server[id]%></option>
        <%}%>
    </select>
    <table id="jqGrid"></table>
    <div id="jqGridPager"></div>
    <span class="oi oi-person"  ></span>
</div>





<%- include('../bpath') %>
<script>
    var branch = '<%=branch%>';
    var handle = 'branch/orderOne';
    var grid_selector = '#jqGrid';
    var pager_selector ='#jqGridPager';
    var sid = "<%=ret.sid%>"
    $("#sid").val(sid);
    $("#sid").on("change",reload);
    function reload() {
        cosjs.reload("?sid="+$("#sid").val());
    }
    //状态，0-初始，1-已经支付，9-完成，10-已处理
    var status_list = {0:'初始',1:'已支付',9:'已发货',10:'已结束',11:'已回收'};

    var option = {
        url : GURL(handle, 'page?sid='+sid),
        colModel : [
            {label: '订单号', name: '_id',key:true,width: 200,editable: false, hidden:true,fixed:true,search:false},
            {label: 'uid', name: 'uid',width: 100,editable: false, hidden:false,fixed:true,search:true},
            {label: 'guid', name: 'guid',width: 200,editable: false, hidden:false,fixed:true,search:true},
            {label: '角色名', name: 'name',width: 100,editable: false, hidden:false,fixed:true,search:true},
            {label: '金额', name: 'val',width: 80,editable: false, hidden:false,fixed:true,search:true},
            {label: '时间', name: 'time',width: 200,editable: false, hidden:false,fixed:true,search:true},
            {label: '付费钻石总值', name: 'zbMax',width: 120,editable: false, hidden:true,fixed:true,search:true},
            {label: '付费钻石余额', name: 'zb',width: 120,editable: false, hidden:true,fixed:true,search:true},
            {label: '付费抽卡券总值', name: 'gcMax',width: 120,editable: false, hidden:true,fixed:true,search:true},
            {label: '付费抽卡券余额', name: 'gc',width: 120,editable: false, hidden:true,fixed:true,search:true},
            {label: '状态', name: 'status',width: 80,editable: false, hidden:false,fixed:true,search:true,formatter:'select', edittype:'select', editoptions:{value:status_list}},
        ],
    }
    $(document).ready(function () {
        cosjs.jqgrid.create(grid_selector,pager_selector,option,{add:false,edit:false,search:true});
    });
</script>

</body>
</html>